'use strict';
// var cluster = require('cluster');
// var numCPUs = require('os').cpus().length;
// if (cluster.isMaster) {
//     for (var i = 0; i < 2; i++) {
//         cluster.fork();
//     }
//     cluster.on('death', function(worker) {
//         console.log('Worker ' + worker.pid + ' died.');
//     });
// } else {
    var kraken = require('kraken-js'),
        app = require('express')(),
        options = require('./lib/spec')(app);


    app.use(kraken(options));


    app.on('start', function() {
        var port = process.env.PORT || app.kraken.get('port');
        app.listen(port, function(err) {
            global.env = app.settings.env;
            console.log('[%s] Listening on http://localhost:%d', app.settings.env, port);
        });
    });
// }